package com.tn.dao.weigh;

import com.tn.controller.alarm.common.model.truck.BindTruckDto;
import com.tn.controller.alarm.common.model.weigh.mq.LicenseDto;
import com.tn.controller.alarm.common.model.weigh.vo.WeighLogInfoVO;
import com.tn.controller.alarm.common.model.weigh.vo.WeighLogQueryVO;
import com.tn.dao.mbpdao.Raster;
import com.tn.dao.mbpdao.Weightloginfo;
import com.tn.entity.QueryMessageVO;
import com.tn.entity.QueryWhiteVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 查询磅房日志信息Dao
 *
 * @program: tn_aucy_java
 * @author: yangjiayao
 * @create: 2021/11/16
 */
@Repository
public interface IWeighDao {

    /**
     * 查询总数
     *
     * @return 总数
     */
    Integer queryCurrentWeighInfoCount();

    /**
     * 查询磅房当前信息
     *
     * @param startIndex 开始索引
     * @param pageSize   页长
     * @return 磅房当前信息
     */
    List<WeighLogInfoVO> queryCurrentWeighLogInfoByPage();

    /**
     * 查询总数
     *
     * @param queryVO 查询条件
     * @return 总数
     */
    Integer queryWeighLogInfoCount(@Param("queryVO") WeighLogQueryVO queryVO);

    /**
     * 查询数据
     *
     * @param startIndex 开始索引
     * @param pageSize   页长
     * @param queryVO    查询条件
     * @return 查询结果
     */
    List<WeighLogInfoVO> queryWeighLogInfoByPage(@Param("startIndex") Integer startIndex,
                                                 @Param("pageSize") Integer pageSize,
                                                 @Param("queryVO") WeighLogQueryVO queryVO);


    /**
     * 查询总数
     *
     * @param queryVO 查询条件
     * @return 总数
     */
    Integer queryWeighLogInfoCount1(@Param("queryVO") WeighLogQueryVO queryVO);

    /**
     * 查询数据
     *
     * @param startIndex 开始索引
     * @param pageSize   页长
     * @param queryVO    查询条件
     * @return 查询结果
     */
    List<WeighLogInfoVO> queryWeighLogInfoByPage1(@Param("startIndex") Integer startIndex,
                                                 @Param("pageSize") Integer pageSize,
                                                 @Param("queryVO") WeighLogQueryVO queryVO);


    /**
     * 查询数据
     *
     * @param queryVO    查询条件
     * @return 查询结果
     */
    List<WeighLogInfoVO> queryWeighLogInfoList(@Param("queryVO") WeighLogQueryVO queryVO);

    /**
     * 修改磅房日志中的车牌
     *
     * @param modifyLicense 修改的车牌
     * @return 修改条数
     */
    int modifyWeighLogLicense(@Param("modifyLicense") String modifyLicense, @Param("truckId") Integer truckId);

    /**
     * 修改闸口日志中的车牌
     *
     * @param modifyLicense 修改的车牌
     * @return 修改条数
     */
    int modifyGateLogLicense(@Param("modifyLicense") String modifyLicense, @Param("truckId") Integer truckId);

    /**
     * 修改货车进场信息中的车牌
     *
     * @param id 货车进场ID
     * @return 修改条数
     */
    int modifyTruckInfoLicense(@Param("id") Integer id, @Param("modifyLicense") String modifyLicense);

    /**
     * 插入车牌识别mq数据
     * @param licenseDto
     */
    void insertLicenseMq(LicenseDto licenseDto);


    List<LicenseDto> selectLicenseMq(LicenseDto licenseDto);

    void deleteLicenseMq(LicenseDto licenseDto);

    void deleteAllLicenseMq(LicenseDto licenseDto);


    WeighLogInfoVO queryWeighLogInfo(Long id);


    WeighLogInfoVO queryWeighLogInfoQP(WeighLogInfoVO vo);


    /**
     * 汇总查询
     *
     * @param queryVO    查询条件
     * @return 查询结果
     */
    List<WeighLogInfoVO> queryWeighLogSumList(@Param("queryVO") WeighLogQueryVO queryVO);


    List<WeighLogInfoVO> queryWeighLogSumDetailList(@Param("queryVO") WeighLogQueryVO queryVO);

    int queryWeighLogSumDetailListCount(@Param("queryVO") WeighLogQueryVO queryVO);

    List<WeighLogInfoVO> queryWeighLogSumDetailListPage(@Param("startIndex") int startIndex, @Param("pageSize") int pageSize,@Param("queryVO") WeighLogQueryVO queryVO);

    List<String> selectWeighLogLicense();

    /**
     * 汇总查询
     *
     * @param queryVO    查询条件
     * @return 查询结果
     */
    List<WeighLogInfoVO> queryWeighSumConditionList();


    String selectTruckInfo(String license);


    String selectStationId(String weightId);


    String selectTagIdByCard(String cardId);



    Map<String,Object> selectQMLastWeigh(String license);

    String selectCompany(@Param("taskNo") String taskNo,@Param("goodsName")String goodsName);


    void updateState(long id);

    String selectNoticeSystemByTask(String taskNo);


    WeighLogInfoVO queryWeighLogInfoQM(WeighLogInfoVO vo1);


    void updateTareWeigh(WeighLogInfoVO weighLogInfoVO);


    void insertRaster(Raster raster);


    void updateRaster(Raster raster);

    Raster selectRaster(Raster raster);


    WeighLogInfoVO queryWeighLogInfoQPLast(WeighLogInfoVO vO);


    WeighLogInfoVO selectLastNoState(WeighLogInfoVO vo);

    void updateLastWeigh(WeighLogInfoVO req);


    WeighLogInfoVO selectLastQP(WeighLogInfoVO vo);

    Integer selectTruckTagStatus(String license);

    void updateTruckTagStatus(String license);

    List<BindTruckDto> getBindInfoLicense();

    Weightloginfo selectLastWeigh(BindTruckDto bindTruckDto);


    Map<String,Object> isNeedTakeCard();

    Integer selectTruckTagStatusNotReturn(String license);


    List<QueryMessageVO> query(String licence);


    List<QueryWhiteVO> queryByLicense(String licence);


    Map getBillPoundMap(String license);
}
